package com.fanpan26.source.queue;

import java.util.concurrent.LinkedBlockingQueue;

/**
 * @author fanpan26
 */
public class LinkedBlockingQueueSourceCode {
    public static void main(String[] args) throws InterruptedException {
        LinkedBlockingQueue<String> queue = new LinkedBlockingQueue<>(5);

        queue.put("a");
        queue.put("b");
        queue.put("c");
        queue.put("d");
        queue.put("e");
        queue.clear();
        //无阻塞
        System.out.println("queue.add(\"a\")="+queue.add("a"));

        //阻塞可打断
        queue.put("b");
        queue.offer("e");

        queue.contains("a");


        queue.size();
        queue.remove("c");
        queue.take();
        queue.poll();
        queue.peek();
        queue.isEmpty();

        queue.remainingCapacity();
        queue.clear();
    }
}
